package com.key.controller.user;

import com.key.common.R;
import com.key.common.dto.ApplyDTO;
import com.key.service.ApplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author tc
 * @create 2023-02-17 10:24
 */
@Api(value = "用户签收",tags = "用户签收接口API")
@Controller
@RequestMapping(value = "/usrSign" )
public class UsrSignController {

    @Autowired
    ApplyService applyService;

    @ResponseBody
    @RequestMapping(value = "/showAllSign",method = RequestMethod.POST)
    @ApiOperation(value = "显示所有签收与未签收申请单",notes = "页面显示申请单",httpMethod = "post")
    public R showAllApply(@RequestBody @ApiParam(name = "applyDTO",value = "",required = true) ApplyDTO applyDTO){
        return applyService.findAllApply(applyDTO);
    }


    @ResponseBody
    @RequestMapping(value = "/signApply",method = RequestMethod.GET)
    @ApiOperation(value = "修改申请单",notes = "修改申请单",httpMethod = "get")
    public R editApplySign(@ApiParam(name = "applyNumber",value = "修改单号",required = true) String applyNumber){
        return applyService.editApplySign(applyNumber);
    }

}
